package com.roger.match.library;

import com.roger.match.library.util.MatchPath;
import ohos.agp.components.AttrSet;
import ohos.agp.utils.TextTool;
import ohos.app.Context;


/**
 * Description:MatchButton View
 * User: Lj
 * Date: 2014-12-03
 * Time: 13:53
 * FIXME
 */
public class MatchButton extends MatchTextView {

    /**
     * 初始化
     *
     * @param context context
     */
    public MatchButton(Context context) {
        super(context);
        init();
    }

    /**
     * 初始化
     *
     * @param context context
     * @param attrs attrs
     */
    public MatchButton(Context context, AttrSet attrs) {
        super(context, attrs);
    }

    /**
     * 初始化
     *
     * @param context context
     * @param attrs attrs
     * @param defStyleAttr defStyleAttr
     */
    public MatchButton(Context context, AttrSet attrs, int defStyleAttr) {
        super(context, attrs, defStyleAttr);
    }

    @Override
    void init() {
        PraseText();
        super.init();
    }

    void PraseText() {
        if (!TextTool.isNullOrEmpty(mContent)) {
            MatchPath.setButtonModule(true);
            StringBuffer strBuffer = new StringBuffer();
            strBuffer.append(MatchPath.V_LEFT);
            strBuffer.append(mContent);
            strBuffer.append(MatchPath.V_RIGHT);
            this.mContent = strBuffer.toString();
        }
    }
}
